package com.dds.system.service.app.impl;

import java.util.List;
import com.dds.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dds.system.mapper.app.AppUserRecommendRelationMapper;
import com.dds.system.domain.app.AppUserRecommendRelation;
import com.dds.system.service.app.IAppUserRecommendRelationService;

/**
 * 用户推荐关系Service业务层处理
 * 
 * @author gaolianjie
 * @date 2021-04-01
 */
@Service
public class AppUserRecommendRelationServiceImpl implements IAppUserRecommendRelationService 
{
    @Autowired
    private AppUserRecommendRelationMapper appUserRecommendRelationMapper;

    /**
     * 查询用户推荐关系
     * 
     * @param userId 用户推荐关系ID
     * @return 用户推荐关系
     */
    @Override
    public AppUserRecommendRelation selectAppUserRecommendRelationById(String userId)
    {
        return appUserRecommendRelationMapper.selectAppUserRecommendRelationById(userId);
    }

    /**
     * 查询用户推荐关系列表
     * 
     * @param appUserRecommendRelation 用户推荐关系
     * @return 用户推荐关系
     */
    @Override
    public List<AppUserRecommendRelation> selectAppUserRecommendRelationList(AppUserRecommendRelation appUserRecommendRelation)
    {
        return appUserRecommendRelationMapper.selectAppUserRecommendRelationList(appUserRecommendRelation);
    }

    /**
     * 新增用户推荐关系
     * 
     * @param appUserRecommendRelation 用户推荐关系
     * @return 结果
     */
    @Override
    public int insertAppUserRecommendRelation(AppUserRecommendRelation appUserRecommendRelation)
    {
        appUserRecommendRelation.setCreateTime(DateUtils.getNowDate());
        return appUserRecommendRelationMapper.insertAppUserRecommendRelation(appUserRecommendRelation);
    }

    /**
     * 修改用户推荐关系
     * 
     * @param appUserRecommendRelation 用户推荐关系
     * @return 结果
     */
    @Override
    public int updateAppUserRecommendRelation(AppUserRecommendRelation appUserRecommendRelation)
    {
        return appUserRecommendRelationMapper.updateAppUserRecommendRelation(appUserRecommendRelation);
    }

    /**
     * 批量删除用户推荐关系
     * 
     * @param userIds 需要删除的用户推荐关系ID
     * @return 结果
     */
    @Override
    public int deleteAppUserRecommendRelationByIds(String[] userIds)
    {
        return appUserRecommendRelationMapper.deleteAppUserRecommendRelationByIds(userIds);
    }

    /**
     * 删除用户推荐关系信息
     * 
     * @param userId 用户推荐关系ID
     * @return 结果
     */
    @Override
    public int deleteAppUserRecommendRelationById(String userId)
    {
        return appUserRecommendRelationMapper.deleteAppUserRecommendRelationById(userId);
    }
}
